import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'


//企业银行卡三要素验证
export const entBankInfoCheck =
  (data) =>
    postAction(
      '/ent/info/entBankCheck',
      data
    )

//获取企业注册类型列表
export const getChannelByUserId =
  () =>
    getAction(
      '/ent/mgr/queryEntTypeList',
      {}
    )

//查询渠道合同服务模式配置
export const getChannelSvConf =
  () =>
    getAction(
      '/svm/mgr/queryChannelSvConf',
      {}
    )


//获取某服务价格(单位分)
export const queryServicePrice =
  (data) =>
    getAction(
      '/ent/info/queryEntSvConfBySvId?serviceConfId=' + data,
    )

//获取渠道注册短链接
export const getRegistMsg =
  (data) =>
    postAction(
      '/ent/mgr/getEntRegistMsg',
      data
    )

//校验法人手机号是否注册
export const getLegalRegist =
  (data) =>
    getAction(
      '/ent/regist/checkLegalRegist?legalPhone=' + data,
    )


//获取经营范围列表
export const getManageNature =
  (meritoFlag,allFlag) =>{
    const urlPaeam =[]
    let tempStr = ''
    if(meritoFlag){
      urlPaeam.push(`meritoFlag=${meritoFlag}`)
    }
    if(allFlag){
      urlPaeam.push(`allFlag=${allFlag}`)
    }
    if(urlPaeam.length>0){
      tempStr = '?'+urlPaeam.join('&')
    }
    return  getAction(
      `/ent/regist/queryManageNature${tempStr}`,
      {}
    )

  }


//自动生成企业名称
export const queryEntNames =
  (data) =>
    postAction(
      '/ent/info/genEntNames',
      data
    )


//保存企业信息(h5)
export const queryEntInfo =
  (data) =>
    postAction(
      '/ent/regist/saveEntInfo',
      data
    )


  /**
   * 邀请负责人线上签署
   * @param {*} data
   * @returns
   */
export const inviteEntSgin =
  (data) =>
    postAction(
      '/ent/inviteEntSgin',
      data
    )
//保存企业信息
export const getEntInfo =
  (data) =>
    postAction(
      '/ent/mgr/saveMgrEntInfo',
      data
    )

//企业提交审核
export const getInfoSubVerify =
  (data) =>
    postAction(
      '/ent/info/subVerify?entId='+data
    )

//企业注册信息查询
export const getEntDetailInfo =
  (data) =>
    getAction(
      '/ent/info/queryEntRegistInfo?entId=' + data,
    )



//渠道管理-渠道费率-适用企业
export const queryApplicable =
  (data) =>
    postAction(
      '/qsb/channel/info/detail/applicableEntNum',
      data
    )

//发送多文档自动签验证码
export const getSendSignCatalogVCode =
  (data) =>
    postAction(
      '/agreeInfo/sendSignCatalogVCode',
      data
    )
//带验证码校验的多文档自动签
export const getDistCatalogSignCert =
  (data) =>
    postAction(
      '/qsb/channel/distCatalogSignCert',
      data
    )
//获取用户手机号，合同url，总分包模式
export const queryLoginChannel =
  () =>
    getAction(
      '/qsb/channel/info/getLoginChannel4Reg',
      {}
    )

//合同签署发送验证码
export const querySignSMS =
  (data) =>
    putAction(
      '/agreeInfo/sendSignSMS?phone='+ data
    )

//合同签署校验验证码
export const queryCheckSMS =
  (data,phone) =>
    putAction(
      '/agreeInfo/checkSignSMS?code=' + data + '&phone=' + phone
    )

//用户完成后调用详情
export const getTemplatePlus =
  (data) =>
    postAction(
      '/agreeInfo/signByTemplatePlus',
      data
    )



//提交合同  ---  用户下载记录
export const getContractRecord =
  (data) =>
    putAction(
      '/agreeInfo/downloadRecord?id=' + data,
    )

//合同详情
export const getContractDetails =
  (data) =>
    getAction(
      '/agreeInfo/detail?id=' + data,
    )


//合同邮寄提交
export const getContractAgree =
  (data) =>
    postAction(
      '/agreeInfo/mailAgree',
      data
    )

//修改合同
export const getContractUpdate =
  (data) =>
    postAction(
      '/agreeInfo/update',
      data
    )

//根据渠道Id校验上上签 并注册
export const checkSSQRegister =
  (data) =>
    postAction(
      '/qsb/channel/checkSSQByCloudChannel?signId=' + data,
    )




//h5获取用户token
export const getLoginTicket =
  (data) =>
    postAction(
      '/zx/sys/loginbyticket',
      data
    )


//企业列表查询
export const getEntList =
  (data) =>
    postAction(
      '/ent/info/queryEntList',
      data
    )


////开票员管理

//开票人列表-按照开票人展示
export const queryInvoicersList =
  (data) =>
    postAction(
      '/electron/issuer/drawerList',
      data
    )

//开票人列表-按照企业展示
export const queryInvoicersEntList =
  (data) =>
    postAction(
      '/electron/issuer/drawerListEnt',
      data
    )
